var left = 0.98;
var right = 0.02;
var currentX = 0.98;
var speed = 1;
var leftToRight = true;

function Update () {
	if (transform.position.x >= left) {
		leftToRight = true;
	} else if (transform.position.x <= right) {
		leftToRight = false;
	}
	if (leftToRight) {
		transform.position.x -= speed * 0.001;
	} else {
		transform.position.x += speed * 0.001;
	}
}